
package ch.hearc.meteo.imp.afficheur.real;

import java.awt.BorderLayout;

import javax.swing.JDialog;

public class JDialogComOptions extends JDialog
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public JDialogComOptions()
		{
		geometry();
		control();
		apparence();
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	/**
	 *  ok = true si l'utilisateur clique sur valider
	 *  ok = false si l'utilisateur clique sur annuler
	 */

	public String getStationName()
		{
		return panelComOptions.getStationName();
		}

	public double getStationLatitude()
		{
		return panelComOptions.getStationLatitude();
		}

	public double getStationLongitude()
		{
		return panelComOptions.getStationLongitude();
		}

	public boolean getOk()
		{
		return panelComOptions.getOk();
		}

	public String getPortName()
		{
		return panelComOptions.getPortName();
		}

	public int getSpeed()
		{
		return panelComOptions.getSpeed();
		}

	public int getDataBits()
		{
		return panelComOptions.getDataBits();
		}

	public int getParity()
		{
		return panelComOptions.getParity();
		}

	public int getStopBits()
		{
		return panelComOptions.getStopBits();
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	private void geometry()
		{
		this.setLayout(new BorderLayout());

		panelComOptions = new JPanelComOptions(this);
		add(panelComOptions, BorderLayout.CENTER);
		}

	private void control()
		{
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setModal(true);
		}

	private void apparence()
		{
		this.setTitle("..::COM Settings::..");
		this.setSize(300, 300);
		this.setResizable(true);
		this.setVisible(true);
		}

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/

	//Tools
	private JPanelComOptions panelComOptions;
	}
